<?php

namespace frontend\models;

use Yii;
use yii\db\ActiveRecord;
use yii\db\Query;
use yii\behaviors\TimestampBehavior;
use yii\db\Exception;
/**
 * This is the model class for table "Notice".
 *
 */
class Notice extends ActiveRecord
{


    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%notice}}';
    }



    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            TimestampBehavior::className(),
        ];
    }
    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [];
    }

    public static function addData($data){
        $model = new static();
        $model->member_id = $data['member_id'];
        $model->posts_id = $data['posts_id'];
        $model->type = $data['type'];
        $model->at_member_id = $data['at_member_id'];
        $model->comment = $data['comment'];
        $model->check_status = $data['check_status'];
        if(!empty($data['check_msg'])){
            $model->check_msg = $data['check_msg'];
        }
        return $model->save();
    }


}
